import request from '@/utils/request.ts'

const PREFIX = '/screen'

const AllUserCount = "/user"
const ArticlesCount = "/articles"
const CommentsCount = "/comments"
const IPAddress = "/ip"
const IpAddressListByDate = "/date"
const IpAddressListByMonth = "/month"
const IpAddressListByYear = "/year"
const CommentlikesCount = "/commentlikes"
const IpAddressListByCity = "/city"
const IpAddressList = "/list"

//查询用户数量
export const getAllUserCountSync = async () => {
    return await request.get(PREFIX + AllUserCount)
}

//获取文章数量
export const getArticlesCountSync = async () => {
    return await request.get(PREFIX + ArticlesCount)
}
//查询评论数量
export const getCommentsCountSync = async () => {
    return await request.get(PREFIX + CommentsCount)
}

// 查询访问次数
export const countIPAddressSync = async () => {
    return await request.get(PREFIX + IPAddress)
}
// 按日期统计流量趋势
export const getIpAddressListByDateSync = async () => {
    return await request.get(PREFIX + IpAddressListByDate)
}
//按月份统计流量趋势
export const getIpAddressListByMonthSync = async () => {
    return await request.get(PREFIX + IpAddressListByMonth)
}
// 按年份统计流量趋势
export const getIpAddressListByYearSync = async () => {
    return await request.get(PREFIX + IpAddressListByYear)
}
//查询点赞数
export const getCommentlikesCountSync = async () => {
    return await request.get(PREFIX + CommentlikesCount)
}
//根据城市查询访问次数
export const getIpAddressListByCitySync = async () => {
    return await request.get(PREFIX + IpAddressListByCity)
}
//查询访问记录
export const getIpAddressListSync = async () => {
    return await request.get(PREFIX + IpAddressList)
}